package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljFoodZongService;
import com.guigu.www.pojo.FoodZong;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.Question;
import com.guigu.www.pojo.TemplateFood;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljFoodZongServlet")
public class LljFoodZongServlet {
    @Autowired
    LljFoodZongService service;
    @GetMapping()
    public PageVo<FoodZong> pageFoodZong(Integer pageNum, Integer pageSize, String foodZongTitle){
        return service.pageFoodZong(pageNum, pageSize, foodZongTitle);
    }
    @PutMapping()
    public void updateFoodZong(Integer foodZongId, Integer foodZongState) {
        service.updateFoodZong(foodZongId, foodZongState);
    }
    @GetMapping("/all")
    public List<TemplateFood> queryAllFood() {
        return service.queryAllFood();
    }
    @PostMapping()
    public void addfood(@RequestBody FoodZong foodZong, Integer[] tempFoodId){
        service.insertFoodZong(foodZong,tempFoodId);
    }
}
